package rpg.util;

public final class Strings {
	private Strings()  {
		super();
	}
	
	public static String trim(Object o)  {
		if (o == null)  {
			return "";
		}
		return o.toString().trim();
	}
	
	public static String toString(Object o)  {
		if (o == null)  {
			return "null";
		}
		return o.toString();
	}

	public static String requireNonEmpty(Object o, String string) {
		String s = trim(o);
		if (s.length() == 0)  {
			throw new IllegalArgumentException(string + " requiresNonEmpty string");
		}
		return s;
	}
}
